function s = matrixSparsity(A, varargin)
    par.epsilon = 1e-8;
    par = process_parameter(par, varargin{:});

    total = size(A,1) * size(A,2);
    if total > 0
        s = sum(A(:) > par.epsilon) / total;
    else
        s = 0;
    end
end
